Skip to main content

Fetch Unread Notification Count

Unread Notification count helps you to show the unread notification which you can use to nudge the user to check the notification feed. You can achieve the same with LikeMinds iOS SDK, by following the steps given below.

Steps to fetch unread notification count

  1. Call getUnreadNotificationCount() function using the instance of LMFeedClient.
  2. Process the response LMResponse<GetUnreadNotificationCountResponse> as per your requirement.
LMFeedClient.shared.getUnreadNotificationCount() {[weak self] response in
// response (LMResponse<GetUnreadNotificationCountResponse>)
if (response.success) {
// your function to process the response data
processResponse(response.data)
} else {
// your function to process error message
processError(response.errorMessage)
}
}

Models

GetUnreadNotificationCountResponse

VARIABLETYPEDESCRIPTIONOPTIONAL
countIntCount of unread notifications.